package br.com.massai.model.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.envers.Audited;

@Entity
@Audited
@Table(name = "TESTE")
@NamedQueries({
	@NamedQuery(name = "Teste.find", query = "SELECT t FROM Teste t"),
	@NamedQuery(name = "Teste.duplicate", query = "SELECT COUNT(t) FROM Teste t WHERE t.idade =:idade")
})
public class Teste implements Serializable {

	private static final long serialVersionUID = 8020716829422306317L;

	@Id
	@SequenceGenerator(name = "seqTeste", sequenceName = "seq_teste", allocationSize = 1)
	@GeneratedValue(generator = "seqTeste", strategy = GenerationType.SEQUENCE)
	private Long id;
	
	@Column(name = "NOME", length = 100)
	private String nome;
	
	@Column(name = "IDADE", precision = 2, scale = 0)
	private Integer idade;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Integer getIdade() {
		return idade;
	}

	public void setIdade(Integer idade) {
		this.idade = idade;
	}

}
